package com.zzzy.cont.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.zzzy.cont.dto.DataRegionDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * 合同文件信息
 *
 * @author fc
 * @since 2024-05-27
 */
@Getter
@Setter
@TableName(value = "con_file", autoResultMap = true)
@Schema(description = "合同文件信息")
public class ConFile {

    @Schema(description = "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "合同ID")
    @TableField("con_id")
    private Long conId;

    @Schema(description = "文件模板名称")
    @TableField("template_name")
    private String templateName;

    @Schema(description = "Word文件二进制流（长度最大为25MB）")
    @TableField("word_file_blob")
    private byte[] wordFileBlob;

    @Schema(description = "移动端审核中打开文件所用二进制流（长度最大为25MB）")
    @TableField("mobile_pdf_blob")
    private byte[] mobilePdfBlob;

    @Schema(description = "PDF文件二进制流（长度最大为25MB）")
    @TableField("pdf_file_blob")
    private byte[] pdfFileBlob;

    @Schema(description = "Word中的修订痕迹数量")
    @TableField("revision_count")
    private Integer revisionCount;

    @Schema(description = "是否固定格式：是、否")
    @TableField("is_fixed_format")
    private String isFixedFormat;

    @Schema(description = "可编辑区域的name、value")
    @TableField(value = "data_regions", typeHandler = JacksonTypeHandler.class)
    private List<DataRegionDto> dataRegions;
}
